<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<c:import url="topShow.jsp" />
<script>

	function newWindow(url) {
		window.open(url, '');
		//  newWindow1.resizeTo(screen.width,screen.height);
	}


	function showDistrict(id) {
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
		} else {
			if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		req.onreadystatechange = displayMessage;
		req.open("POST", "<%=request.getContextPath()%>/monitor/getDistrictInfo/"+id, true);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		req.send(null);
	}

	function showDisDep(id){
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
		} else {
			if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		req.onreadystatechange = displayMessageForDis;
		req.open("POST", "<%=request.getContextPath()%>/monitor/getDisDepInfo/"+id, true);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		req.send(null);
	}
	
	function displayMessage() {
		
		if (req.readyState == 4 && req.status == 200) {
			var newTab = req.responseText;
			setInnerHTML(document.getElementById("showDistrictDiv"),
					newTab);
		}
	}

	function displayMessageForDis() {
		
		if (req.readyState == 4 && req.status == 200) {
			var newTab = req.responseText;
			setInnerHTML(document.getElementById("showDepartment"),
					newTab);
		}
	}
	
	var setInnerHTML = function (el, htmlCode) {
	  var ua = navigator.userAgent.toLowerCase();
	  if (ua.indexOf('msie') >= 0 && ua.indexOf('opera') < 0) {
	    htmlCode = '<div style="display:none">for IE</div>' + htmlCode;
	    htmlCode = htmlCode.replace(/<script([^>]*)>/gi, '<script$1 defer="true">');
	    el.innerHTML = htmlCode;
	    el.removeChild(el.firstChild);
	  } else {
	    var el_next = el.nextSibling;
	    var el_parent = el.parentNode;
	    el_parent.removeChild(el);
	    el.innerHTML = htmlCode;
	    el_next ? el_parent.insertBefore(el, el_next) : el_parent.appendChild(el);
	  }
	}
	
</script>
<body>

<table align="center">
	<tr>
		<td width="800" valign="top">
		<div style="width:880px;margin:0 auto;text-align: center"><span style="font-size:30px;font-weight:bold">发布项目数量统计</span></div>
		<div style="width:880px;margin:0 auto;">
			<div align="center" style="width:800px;height:30px;margin:0 auto;margin-top:10px;border-bottom: 1px solid">
				<span style="float:right;margin-left:10px;font-weight: bold;margin-top:5px">已发布项目总数：${totalProCount} 个</span>
			</div>

		<div align="center" style="margin-top: 20px">
		<table width="800" height="150" border="1" align="center"
			bordercolor="#E8E7E6" bgcolor="#FFFFFF">
			<tr align="center" valign="middle">
				<th colspan="4" bgcolor="#BECAE3">省级部门发布总数 ${provSum} 条</th>
			</tr>
			<c:forEach items="${provDepts}" var="provDept" varStatus="status">
				<c:if test="${(status.count%4)==1}">
					<tr align="center" valign="middle">
				</c:if>
				<td width="25%" style="padding: 3px">
				${provDept.departmentName}<br />
				<a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=${provDept.depId}');"><span>(${provDept.pid}
				条)</span></a></td>
				<c:if test="${status.last}">
					<c:if test="${(status.count%4)!=0}">
						<c:forEach begin="1" end="${4-(status.count%4)}" var="i">
							<td>&nbsp;</td>
						</c:forEach>
					</c:if>
				</c:if>
				<c:if test="${(status.count%4)==0}">
					</tr>
				</c:if>
			</c:forEach>
		</table>
		</div>
		<br />
		<div align="center">
		<table width="800" height="250" border="1" align="center"
			bordercolor="#E8E7E6" bgcolor="#FFFFFF">
			<tr bgcolor="#FFFFFF">
				<th colspan="4" bgcolor="#BECAE3">市州发布总数 ${citySum}条</th>
			</tr>
			<tr align="center" valign="middle" bgcolor="#FFFFFF">
				<td width="25%"><a href="javascript:showDistrict(5101)">成都市</a>
				<a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=510100000')"><span>(${cityProCount[0]}条)</span></a></td>
				<td width="25%"><a href="javascript:showDistrict(5103)">自贡市</a>
				<a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=510300000')"><span>(${cityProCount[1]}条)</span></a></td>
				<td width="25%"><a href="javascript:showDistrict(5104)">攀枝花市</a>
				<a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=510400000')"><span>(${cityProCount[2]}条)</span></a></td>
				<td width="25%"><a href="javascript:showDistrict(5105)">泸州市</a>
				<a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=510500000')"><span>(${cityProCount[3]}条)</span></a></td>
			</tr>
			<tr align="center" valign="middle" bgcolor="#FFFFFF">
				<td><a href="javascript:showDistrict(5106)">德阳市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=510600000')"><span>(${cityProCount[4]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5107)">绵阳市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=510700000')"><span>(${cityProCount[5]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5108)">广元市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=510800000')"><span>(${cityProCount[6]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5109)">遂宁市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=510900000')"><span>(${cityProCount[7]}条)</span></a></td>
			</tr>
			<tr align="center" valign="middle" bgcolor="#FFFFFF">
				<td><a href="javascript:showDistrict(5110)">内江市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=511000000')"><span>(${cityProCount[8]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5111)">乐山市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=511100000')"><span>(${cityProCount[9]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5113)">南充市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=511300000')"><span>(${cityProCount[10]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5114)">眉山市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=511400000')"><span>(${cityProCount[11]}条)</span></a></td>
			</tr>
			<tr align="center" valign="middle" bgcolor="#FFFFFF">
				<td><a href="javascript:showDistrict(5115)">宜宾市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=511500000')"><span>(${cityProCount[12]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5116)">广安市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=511600000')"><span>(${cityProCount[13]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5117)">达州市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=511700000')"><span>(${cityProCount[14]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5118)">雅安市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=511800000')"><span>(${cityProCount[15]}条)</span></a></td>
			</tr>
			<tr align="center" valign="middle" bgcolor="#FFFFFF">
				<td><a href="javascript:showDistrict(5119)">巴中市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=511900000')"><span>(${cityProCount[16]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5120)">资阳市</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=512000000')"><span>(${cityProCount[17]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5132)">阿坝州</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=513200000')"><span>(${cityProCount[18]}条)</span></a></td>
				<td><a href="javascript:showDistrict(5133)">甘孜州</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=513300000')"><span>(${cityProCount[19]}条)</span></a></td>
			</tr>
			<tr align="center" valign="middle" bgcolor="#FFFFFF">
				<td><a href="javascript:showDistrict(5134)">凉山州</a> <a
					href="javascript:newWindow('<%=request.getContextPath()%>/monitor/projectList?did=513400000')"><span>(${cityProCount[20]}条)</span></a></td>

				<td align="center" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>
				<td align="center" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>
				<td align="center" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>
			</tr>
		</table>
		</div>

		<br />
		
			<div id="showDistrictDiv" align="center">
			</div>
		
		</div>
		</td>
	</tr>
</table>
</body>
</html>
